//
//  WHContactsDetailCell.m
//  AddressBook
//
//  Created by  on 2020/7/28.
//  Copyright © 2020 wh. All rights reserved.
//

#import "WHContactsDetailCell.h"
#import "MacroDefinition.h"
#import "Masonry.h"

@interface WHContactsDetailCell()

@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UILabel *contentLabel;

@end

@implementation WHContactsDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initWithView];
    }
    return self;
}

- (void)initWithView
{
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.contentLabel];
}

- (void)setDetailCellDataWithTitle:(NSString *)title content:(NSString *)content
{
    self.titleLabel.text = title;
    self.contentLabel.text = content;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(5, 5, ScreenWidth-10, 30);
    self.contentLabel.frame = CGRectMake(5, 35, ScreenWidth-10, 25);
}

- (UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.textColor = UIColor.blackColor;
        _titleLabel.font = [UIFont systemFontOfSize:20];
        _titleLabel.text = @"标题";
    }
    return _titleLabel;
}

- (UILabel *)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.textColor = UIColor.blueColor;
        _contentLabel.font = [UIFont systemFontOfSize:16];
        _contentLabel.text = @"内容";
    }
    return _contentLabel;
}
@end
